<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">
    <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
        
        <el-col :span="8">
          <el-form-item label="公司名称" prop="FYEAR" >
            <el-input v-model="dataForm.FYEAR"   />
          </el-form-item>
        </el-col>

         <el-col :span="16">
          <el-form-item label="联系地址" prop="FCATNO" >
            <el-input v-model="dataForm.FCATNO"   />
          </el-form-item>
        </el-col>
          
        <el-col :span="8">
          <el-form-item label="人员姓名" prop="FUSER" >
            <el-input v-model="dataForm.FUSER"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="手机号码" prop="FPARENTNO" >
            <el-input v-model="dataForm.FPARENTNO"   />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="邮箱地址" prop="FCLASS" >
            <el-input v-model="dataForm.FCLASS"   />
          </el-form-item>
        </el-col>


        <el-col :span="8">
          <el-form-item label="有效起日" prop="FBEGDATE" disabled>
            <el-date-picker v-model="dataForm.FBEGDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>

        </el-form-item>

        </el-col>

        <el-col :span="8">
          <el-form-item label="有效讫日" prop="FENDDATE" disabled>
            <el-date-picker v-model="dataForm.FENDDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

        <el-col :span="8">
            <el-form-item label="人员状态">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="5">
          <el-form-item label="">
            <!-- <el-button type="success" icon="el-icon-plus" @click="insert">添加场地</el-button> -->
            <el-button type="primary" :loading="loading" @click="closePage">返回</el-button>
          </el-form-item>
        </el-col>

        
      </el-form>
    </el-row>

    <el-table :data="list" border stripe>
      <el-table-column prop="FENTRYID" label="序号" ></el-table-column>
      <el-table-column prop="FGRAND" label="所属教学楼" ></el-table-column>
      <el-table-column prop="FLEVEL" label="所属楼层"></el-table-column>
      <el-table-column prop="FPOINT" label="场地名称" ></el-table-column>
    </el-table>
    <StudqueryFcuston ref="StudqueryFcuston" @confirm="shoplist" />
  </el-dialog>
</template>
<script>
  import StudqueryFcuston from "@/components/StudqueryFcuston/StudqueryFcuston.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    components: { StudqueryFcuston },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        title: "查看详情",
        insertorupdate: true,
        dataForm: {
          FYEAR :"上海嘉华生物",
          FPARENTNO:"1800***3543",
          FCLASS:"241003@qq.com",
          FCATNO:"上海金山工业区1路10号",
          FUSER: "柴荣",
          FNOTE: "",
          FBEGDATE: "2024-12-01",
          FENDDATE: "2025-11-30",
          FBILLSTATE:"申请"
        },
        rules: {
        },
        list: [{  "FENTRYID":1,
                  "FGRAND": "综合实验楼",
                  "FLEVEL": "一楼",
                  "FPOINT": "奉综教楼201"
                },
                { "FENTRYID":2,
                  "FGRAND": "综合实验楼",
                  "FLEVEL": "一楼",
                  "FPOINT": "奉综教楼202"
                }],
        loading: false,
        visible: false,

        //所属校区选择数据
        options1: [{
          value: 'L001',
          label: '申请'
        }, {
          value: 'L002',
          label: '通过'
        }, {
          value: 'L003',
          label: '驳回'
        }, {
          value: 'L004',
          label: '取消'
        }],

        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      closePage(){
        console.log('关闭弹窗dialog');
        this.visible = false;
      },
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      insert() {
        this.$refs.StudqueryFcuston.open();
      },
      shoplist(data) {
        data.forEach(item => {
          this.list.push({
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "1"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "曹操"
          },{
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "2"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "刘备"
          })
        });
      },
      //
      cancel() {
        this.$refs.elForm.resetFields();
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>